import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/home'
import Login from '@/views/login'
import Message from '@/views/message'
import Mine from '@/views/mine'
import Begin from '@/views/begin'
import OpenDoor from '@/views/openDoor'
import Serve from '@/views/serve'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: 'home',
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
  },
  {
    path: '/message',
    name: 'message',
    component: Message,
  },
  {
    path: '/mine',
    name: 'mine',
    component: Mine,
  },
  {
    path: '/begin',
    name: 'begin',
    component: Begin,
  },
  {
    path: '/openDoor',
    name: 'openDoor',
    component: OpenDoor,
  },
  {
    path: '/serve',
    name: 'serve',
    component: Serve,
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
})

export default router
